/*
 * Copyright (C) 2011 Dirk Weißenborn, dirk.weissenborn@gmail.com
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.weissenborn.colabtex.server.etherpad;

import java.util.Map;

/**
 * The Class EtherpadApiResult is an representer of the etherpad api response, parsed with gson
 */
abstract class EtherpadApiResult {	
	
	/** The message. */
	String message;
	
	/** The code. */
	Long code;
	
	/**
	 * Gets the data.
	 *
	 * @return the data
	 */
	public abstract Object getData();
	
	/**
	 * Gets the message.
	 *
	 * @return the message
	 */
	public String getMessage() {
		return message;
	}
	
	/**
	 * Gets the code.
	 *
	 * @return the code
	 */
	public Long getCode() {
		return code;
	}	
	
}

class EtherpadGroupResult extends EtherpadApiResult {
	class Data {
		public String groupID;
	}
	
	Data data;

	@Override
	public Data getData() {
		return data;
	}	
}

class EtherpadNullResult extends EtherpadApiResult {
	Object data;
	
	@Override
	public Object getData() {
		return data;
	}
}

//"data":{"padIDs":["g.VfhEA9NnxyzA0iJ6$test222222","g.VfhEA9NnxyzA0iJ6$pad333333","g.VfhEA9NnxyzA0iJ6$test444444"]}}
class EtherpadPadListResult extends EtherpadApiResult {
	class Data {
		public String[] padIDs;
	}
	
	Data data;

	@Override
	public Data getData() {
		return data;
	}	
}

class EtherpadPadResult extends EtherpadApiResult {
	class Data {
		public String padID;
	}
	
	Data data;

	@Override
	public Data getData() {
		return data;
	}	
}

class EtherpadAuthorResult extends EtherpadApiResult {
	class Data {
		public String authorID;
	}
	
	Data data;

	@Override
	public Data getData() {
		return data;
	}	
}

class EtherpadTextResult extends EtherpadApiResult {
	class Data {
		public String text;
	}
	
	Data data;

	@Override
	public Data getData() {
		return data;
	}	
}

class EtherpadReadOnlyResult extends EtherpadApiResult {
	class Data {
		public String readOnlyID;
	}
	
	Data data;

	@Override
	public Data getData() {
		return data;
	}	
}
